#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 10;

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	long int n, m, k;
	cin >> n >> m >> k;
	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			char c;
			cin >> c;
			if (c == '1')
				cnt++;
		}
	}
	cout << cnt - 2 * k << ' ' << 3 * k - cnt;
	return 0;
}